#ifndef WF_IMALIGNED_H
#define WF_IMALIGNED_H

#include "wf_dimension.h"
#include "pf_dimaligned.h"
#include "gui_export.h"
/**
 * This action class can handle user events to draw 
 * aligned dimensions.
 *
 */
class GUI_EXPORT WF_DimAligned : public WF_Dimension {
	Q_OBJECT
public:
    /**
     * Action States.
     */
    enum Status {
        SetExtPoint1,    /**< Setting the 1st ext point.  */
        SetExtPoint2,    /**< Setting the 2nd ext point. */
        SetDefPoint,     /**< Setting the common def point */
		SetText          /**< Setting the text label in command line */
    };

public:
    WF_DimAligned(PF_Container& container,
                        PF_GraphicView& graphicView);
    ~WF_DimAligned();

	static QAction* createGUIAction(LX_Define::ActionType /*type*/, QObject* /*parent*/);
	
	virtual LX_Define::ActionType rtti() {
		return LX_Define::ActionDimAligned;
	}

    virtual void reset();

    virtual void trigger();
	void preparePreview();
	
    virtual void mouseMoveEvent(QMouseEvent* e);
    virtual void mouseReleaseEvent(QMouseEvent* e);

	virtual void coordinateEvent(PF_CoordinateEvent* e);
    virtual void commandEvent(PF_CommandEvent* e);
        virtual QStringList getAvailableCommands();
	
    virtual void hideOptions();
    virtual void showOptions();
	
    virtual void updateMouseButtonHints();

protected:
    /**
     * Aligned dimension data.
     */
    PF_DimAlignedAttribute edata;

	/** Last status before entering text. */
	Status lastStatus;
}
;

#endif
